package org.bonn.ooka.persistence;

import java.util.Map;

import org.bonn.ooka.model.ComponentPointer;

public class DBProxy implements IDBConnector {
	IDBConnector conn;

	public DBProxy() {
		try {
			this.conn = new DBConnector();
		} catch (Exception e) {
			this.conn = null;
		}
	}

	@Override
	public boolean persistConfiguration(
			Map<String, ComponentPointer<String>> pointerList) {
		if ( conn != null ) {
			return conn.persistConfiguration(pointerList);
		}
		return true;
	}

	@Override
	public Map<String, ComponentPointer<String>> getConfiguration() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean closeConnection() {
		if ( this.conn != null ) {
			return this.conn.closeConnection();
		}
		return true;
	}

}
